\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align}
  f(x) &= \bigg\lvert 0 \bigg\rvert \\
  f(x) &= \Bigg\lVert 0 \Bigg\rVert \\
\end{align}

\[
  \begin{multlined}[b]
    \framebox[4cm]{first} \\
    \framebox[4cm]{last}
  \end{multlined} = B
  \begin{multlined}[b][7cm]
    \framebox[4cm]{first} \\
    \framebox[4cm]{last}
  \end{multlined} = B
\]

\begin{align*}
  f(a) &=
  \!\begin{aligned}[t]
    & \frac{1}{2}+\cdots \\& \dots+\frac{1}{2}
  \end{aligned}
\end{align*}

\begin{equation}
  \begin{lgathered}[c]
    x=1,\quad x+1=2 \\
    y=235
  \end{lgathered}
\end{equation}

\[
  \begin{pmatrix*}[r]
    -1 & 3 \\
    2  & -4
  \end{pmatrix*}
\]

\[
  \begin{smallmatrix*}[r]
    -1 & 3 \\
    2  & -4
  \end{smallmatrix*}
\]

\end{document}
